package string;
/** length() 长度 */
public class LengthDemo {
    public static void main(String[] args) {
        //获取字符串的长度(字符个数)
        String str = "我爱Java!2302"+"生日快乐";
        int len = str.length();
        System.out.println(len);//15

        String str1 = "我爱这个世界!";
        int len1 = str1.length();
        System.out.println(len1);


    }
}
